<extend name='Index:index'/>
<block name='admin_right'>
	<div class="right col-md-9">
		<form class="col-sm-7 form-horizontal" action="<{:U('add_handle')}>" method="post" enctype="multipart/form-data">
		  <div class="form-group">
		    <label class="col-sm-4 control-label">商品名称</label>
		    <div class="col-sm-5">
		      <input type="text" class="form-control " name="name" value="">
		    </div>
		  </div>
		  <div class="form-group">
		    <label class="col-sm-4 control-label">商品价格</label>
		    <div class="col-sm-3">
		      <input type="text" class="form-control " name="price">
		    </div>
		  </div>
		  <div class="form-group">
		    <label class="col-sm-4 control-label">库存</label>
		    <div class="col-sm-3">
		      <input type="text" class="form-control " name="stock">
		    </div>
		  </div>
		 <div class="form-group">
		   <label class="col-sm-4 control-label">是否上架</label>
		   <div class="col-sm-3">
		   		<input type="radio" checked name='shelf' value='1'>上架
		   		<input type="radio" name='shelf' value='0'>下架
		   </div>
		 </div>
		 <div class="form-group">
		   <label class="col-sm-4 control-label">品牌分类</label>
		   <div class="col-sm-3">
		     <select class="form-control" name="class_brand" id="">
		     	<volist name='classrows' id='classrow'><!-- 循环分类 -->
		     		<option value="<{$classrow['id']}>" disabled><{$classrow['name']}></option><!-- 分类加disabled变成不可选 -->
		     		<volist name='brandrows' id='brandrow'>
		     			<if condition="$brandrow['class_id'] eq $classrow['id']"><!-- 如果品牌表的class_id等于分类表里的id显示同一分类下的品牌 -->
		     				<option value="<{$classrow['id']}>-<{$brandrow['id']}>">|--<{$brandrow['name']}></option> <!-- value值显示class_id-brand_id  php拆分获得分类id，品牌id-->
		     			</if>
		     		</volist>
		     	</volist>
		     </select>
		   </div>
		 </div>
		 <div class="form-group">
		   <label class="col-sm-4 control-label">上传图片</label>
		   <div class="col-sm-3">
		     <input type="file"  name="img">
		   </div>
		 </div>
		  <div class="form-group">
		    <div class="col-sm-offset-2 col-sm-10">
		      <button type="submit" class="btn btn-primary">添加</button>
		      <button type="reset" class="btn btn-danger">取消</button>
		    </div>
		  </div>
		</form>
	</div>
</block>